<template>

  <el-table
    :data="tableData"
    style="width: 100%"
  >
    <el-input
      placeholder="请输入内容"
      v-model="input"
      clearable>
    </el-input>
    <el-table-column
      fixed
      prop="province"
      label="省">
    </el-table-column>
    <el-table-column
      prop="city"
      label="市">
    </el-table-column>
    <el-table-column
      prop="operator"
      label="运营商">
    </el-table-column>
    <el-table-column
      prop="phoneNumber"
      label="号码">
    </el-table-column>
  </el-table>

</template>
<style>

</style>

<script>
export default {
  data() {
    return {
      tableData: [],
      centerDialogVisible: false,
      editform: {
        id: '',
        name: '',
        age: '',
        email: '',
        money: ''
      }
    }
  },
  methods: {
    saveOrUpdate(row) {
      console.log(row);

    },
    del(row) {
      console.log(row);
      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.delete('api/user/del/' + row.id, {}).then((response) => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
          this.getList(this.tableData);
        }).catch((response) => {
          console.log(response + "删除失败");
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    getList() {
      this.$axios.get('api/queryBelong', {}).then((response) => {
        this.tableData = response.data.data;
      }).catch((response) => {
        console.log(response);
      })
    }
  },
  created() {
    this.getList()
  }
}
</script>
